Function: remove(domElement, boolDoNotDelete) Description: Removes the referenced element plus all DOM nodes and associated data within its children. Returns: domElement, null, or $A object if chained. Note: All attached event handlers and data bindings are also removed to prevent memory leaks. When boolDoNotDelete is true, only the attached events and associated data are removed before the referenced element is returned. When boolDoNotDelete is false or undefined, all contained nodes are removed. Example: // Remove a DOM element and delete all associated event bindings and data $A.remove(domElement); // Don't remove a DOM element and delete all associated event bindings and data var myElement = $A.remove(domElement, true); // Or the same using chaining // Remove a DOM element and delete all associated event bindings and data $A(domElement).remove(); // Don't remove a DOM element and delete all associated event bindings and data var myChain = $A(domElement).remove(true); // To return the modified element within a chain, use the "return()" method. var myElement = myChain.return();